/**
 * @author 木人心
 * @version 1.0.0
 */
import { RouteRecordRaw } from 'vue-router'
import { ImportComment } from '@typings/comment'

declare module 'vue-router' {
  interface RouteMeta {
    title?: string,
    subtitle?: string,
    icon?: ImportComment,
    activeMenu?: string,
    role?: string[]
    permission?: string,
    isMenu?: boolean
  }
}

export type RouteModule = { routes: RouteRecordRaw[], isMenu?: boolean }
export type RouteModules = Record<string, RouteModule>

export const createModule = (routes: RouteRecordRaw[], isMenu = false): RouteModule => { return { routes, isMenu } }
